// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;
using System.Collections.Generic;

namespace SnapObjects.Data
{
    public class SqlKeywords
    {
        protected static IDictionary<string, SqlKeywords> _members
            = new Dictionary<string, SqlKeywords>(StringComparer.OrdinalIgnoreCase);

        protected string _name;

        protected SqlKeywords(string name)
        {
            this.Register(name);
        }

        protected virtual void Register(string name)
        {
            if (!_members.ContainsKey(name))
            {
                _members.Add(name, this);
            }

            _name = name;
        }

        public static SqlKeywords Parse(string value)
        {
            if (_members.ContainsKey(value))
            {
                return _members[value];
            }

            return NOTHING;
        }

        public static bool IsKeyword(string value)
        {
            return _members.ContainsKey(value);
        }

        public override string ToString()
        {
            return _name;
        }

        public static readonly SqlKeywords NOTHING = new SqlKeywords(String.Empty);

        public static readonly SqlKeywords ABSOLUTE = new SqlKeywords("ABSOLUTE");
        public static readonly SqlKeywords ACTION = new SqlKeywords("ACTION");
        public static readonly SqlKeywords ADA = new SqlKeywords("ADA");
        public static readonly SqlKeywords ADD = new SqlKeywords("ADD");
        public static readonly SqlKeywords ALL = new SqlKeywords("ALL");
        public static readonly SqlKeywords ALLOCATE = new SqlKeywords("ALLOCATE");
        public static readonly SqlKeywords ALTER = new SqlKeywords("ALTER");
        public static readonly SqlKeywords AND = new SqlKeywords("AND");
        public static readonly SqlKeywords ANY = new SqlKeywords("ANY");
        public static readonly SqlKeywords ARE = new SqlKeywords("ARE");
        public static readonly SqlKeywords AS = new SqlKeywords("AS");
        public static readonly SqlKeywords ASC = new SqlKeywords("ASC");
        public static readonly SqlKeywords ASSERTION = new SqlKeywords("ASSERTION");
        public static readonly SqlKeywords AT = new SqlKeywords("AT");
        public static readonly SqlKeywords AUTHORIZATION = new SqlKeywords("AUTHORIZATION");
        public static readonly SqlKeywords AVG = new SqlKeywords("AVG");
        public static readonly SqlKeywords BEGIN = new SqlKeywords("BEGIN");
        public static readonly SqlKeywords BETWEEN = new SqlKeywords("BETWEEN");
        public static readonly SqlKeywords BIT = new SqlKeywords("BIT");
        public static readonly SqlKeywords BIT_LENGTH = new SqlKeywords("BIT_LENGTH");
        public static readonly SqlKeywords BOTH = new SqlKeywords("BOTH");
        public static readonly SqlKeywords BY = new SqlKeywords("BY");
        public static readonly SqlKeywords CASCADE = new SqlKeywords("CASCADE");
        public static readonly SqlKeywords CASCADED = new SqlKeywords("CASCADED");
        public static readonly SqlKeywords CASE = new SqlKeywords("CASE");
        public static readonly SqlKeywords CAST = new SqlKeywords("CAST");
        public static readonly SqlKeywords CATALOG = new SqlKeywords("CATALOG");
        public static readonly SqlKeywords CHAR = new SqlKeywords("CHAR");
        public static readonly SqlKeywords CHAR_LENGTH = new SqlKeywords("CHAR_LENGTH");
        public static readonly SqlKeywords CHARACTER = new SqlKeywords("CHARACTER");
        public static readonly SqlKeywords CHARACTER_LENGTH = new SqlKeywords("CHARACTER_LENGTH");
        public static readonly SqlKeywords CHECK = new SqlKeywords("CHECK");
        public static readonly SqlKeywords CLOSE = new SqlKeywords("CLOSE");
        public static readonly SqlKeywords COALESCE = new SqlKeywords("COALESCE");
        public static readonly SqlKeywords COLLATE = new SqlKeywords("COLLATE");
        public static readonly SqlKeywords COLLATION = new SqlKeywords("COLLATION");
        public static readonly SqlKeywords COLUMN = new SqlKeywords("COLUMN");
        public static readonly SqlKeywords COMMIT = new SqlKeywords("COMMIT");
        public static readonly SqlKeywords CONNECT = new SqlKeywords("CONNECT");
        public static readonly SqlKeywords CONNECTION = new SqlKeywords("CONNECTION");
        public static readonly SqlKeywords CONSTRAINT = new SqlKeywords("CONSTRAINT");
        public static readonly SqlKeywords CONSTRAINTS = new SqlKeywords("CONSTRAINTS");
        public static readonly SqlKeywords CONTINUE = new SqlKeywords("CONTINUE");
        public static readonly SqlKeywords CONVERT = new SqlKeywords("CONVERT");
        public static readonly SqlKeywords CORRESPONDING = new SqlKeywords("CORRESPONDING");
        public static readonly SqlKeywords COUNT = new SqlKeywords("COUNT");
        public static readonly SqlKeywords CREATE = new SqlKeywords("CREATE");
        public static readonly SqlKeywords CROSS = new SqlKeywords("CROSS");
        public static readonly SqlKeywords CURRENT = new SqlKeywords("CURRENT");
        public static readonly SqlKeywords CURRENT_DATE = new SqlKeywords("CURRENT_DATE");
        public static readonly SqlKeywords CURRENT_TIME = new SqlKeywords("CURRENT_TIME");
        public static readonly SqlKeywords CURRENT_TIMESTAMP = new SqlKeywords("CURRENT_TIMESTAMP");
        public static readonly SqlKeywords CURRENT_USER = new SqlKeywords("CURRENT_USER");
        public static readonly SqlKeywords CURSOR = new SqlKeywords("CURSOR");
        public static readonly SqlKeywords DATE = new SqlKeywords("DATE");
        public static readonly SqlKeywords DAY = new SqlKeywords("DAY");
        public static readonly SqlKeywords DEALLOCATE = new SqlKeywords("DEALLOCATE");
        public static readonly SqlKeywords DEC = new SqlKeywords("DEC");
        public static readonly SqlKeywords DECIMAL = new SqlKeywords("DECIMAL");
        public static readonly SqlKeywords DECLARE = new SqlKeywords("DECLARE");
        public static readonly SqlKeywords DEFAULT = new SqlKeywords("DEFAULT");
        public static readonly SqlKeywords DEFERRABLE = new SqlKeywords("DEFERRABLE");
        public static readonly SqlKeywords DEFERRED = new SqlKeywords("DEFERRED");
        public static readonly SqlKeywords DELETE = new SqlKeywords("DELETE");
        public static readonly SqlKeywords DESC = new SqlKeywords("DESC");
        public static readonly SqlKeywords DESCRIBE = new SqlKeywords("DESCRIBE");
        public static readonly SqlKeywords DESCRIPTOR = new SqlKeywords("DESCRIPTOR");
        public static readonly SqlKeywords DIAGNOSTICS = new SqlKeywords("DIAGNOSTICS");
        public static readonly SqlKeywords DISCONNECT = new SqlKeywords("DISCONNECT");
        public static readonly SqlKeywords DISTINCT = new SqlKeywords("DISTINCT");
        public static readonly SqlKeywords DOMAIN = new SqlKeywords("DOMAIN");
        public static readonly SqlKeywords DOUBLE = new SqlKeywords("DOUBLE");
        public static readonly SqlKeywords DROP = new SqlKeywords("DROP");
        public static readonly SqlKeywords ELSE = new SqlKeywords("ELSE");
        public static readonly SqlKeywords END = new SqlKeywords("END");
        public static readonly SqlKeywords ENDEXEC = new SqlKeywords("END-EXEC");
        public static readonly SqlKeywords ESCAPE = new SqlKeywords("ESCAPE");
        public static readonly SqlKeywords EXCEPT = new SqlKeywords("EXCEPT");
        public static readonly SqlKeywords EXCEPTION = new SqlKeywords("EXCEPTION");
        public static readonly SqlKeywords EXEC = new SqlKeywords("EXEC");
        public static readonly SqlKeywords EXECUTE = new SqlKeywords("EXECUTE");
        public static readonly SqlKeywords EXISTS = new SqlKeywords("EXISTS");
        public static readonly SqlKeywords EXTERNAL = new SqlKeywords("EXTERNAL");
        public static readonly SqlKeywords EXTRACT = new SqlKeywords("EXTRACT");
        public static readonly SqlKeywords FALSE = new SqlKeywords("FALSE");
        public static readonly SqlKeywords FETCH = new SqlKeywords("FETCH");
        public static readonly SqlKeywords FIRST = new SqlKeywords("FIRST");
        public static readonly SqlKeywords FLOAT = new SqlKeywords("FLOAT");
        public static readonly SqlKeywords FOR = new SqlKeywords("FOR");
        public static readonly SqlKeywords FOREIGN = new SqlKeywords("FOREIGN");
        public static readonly SqlKeywords FORTRAN = new SqlKeywords("FORTRAN");
        public static readonly SqlKeywords FOUND = new SqlKeywords("FOUND");
        public static readonly SqlKeywords FROM = new SqlKeywords("FROM");
        public static readonly SqlKeywords FULL = new SqlKeywords("FULL");
        public static readonly SqlKeywords GET = new SqlKeywords("GET");
        public static readonly SqlKeywords GLOBAL = new SqlKeywords("GLOBAL");
        public static readonly SqlKeywords GO = new SqlKeywords("GO");
        public static readonly SqlKeywords GOTO = new SqlKeywords("GOTO");
        public static readonly SqlKeywords GRANT = new SqlKeywords("GRANT");
        public static readonly SqlKeywords GROUP = new SqlKeywords("GROUP");
        public static readonly SqlKeywords HAVING = new SqlKeywords("HAVING");
        public static readonly SqlKeywords HOUR = new SqlKeywords("HOUR");
        public static readonly SqlKeywords IDENTITY = new SqlKeywords("IDENTITY");
        public static readonly SqlKeywords IMMEDIATE = new SqlKeywords("IMMEDIATE");
        public static readonly SqlKeywords IN = new SqlKeywords("IN");
        public static readonly SqlKeywords INCLUDE = new SqlKeywords("INCLUDE");
        public static readonly SqlKeywords INDEX = new SqlKeywords("INDEX");
        public static readonly SqlKeywords INDICATOR = new SqlKeywords("INDICATOR");
        public static readonly SqlKeywords INITIALLY = new SqlKeywords("INITIALLY");
        public static readonly SqlKeywords INNER = new SqlKeywords("INNER");
        public static readonly SqlKeywords INPUT = new SqlKeywords("INPUT");
        public static readonly SqlKeywords INSENSITIVE = new SqlKeywords("INSENSITIVE");
        public static readonly SqlKeywords INSERT = new SqlKeywords("INSERT");
        public static readonly SqlKeywords INT = new SqlKeywords("INT");
        public static readonly SqlKeywords INTEGER = new SqlKeywords("INTEGER");
        public static readonly SqlKeywords INTERSECT = new SqlKeywords("INTERSECT");
        public static readonly SqlKeywords INTERVAL = new SqlKeywords("INTERVAL");
        public static readonly SqlKeywords INTO = new SqlKeywords("INTO");
        public static readonly SqlKeywords IS = new SqlKeywords("IS");
        public static readonly SqlKeywords ISOLATION = new SqlKeywords("ISOLATION");
        public static readonly SqlKeywords JOIN = new SqlKeywords("JOIN");
        public static readonly SqlKeywords KEY = new SqlKeywords("KEY");
        public static readonly SqlKeywords LANGUAGE = new SqlKeywords("LANGUAGE");
        public static readonly SqlKeywords LAST = new SqlKeywords("LAST");
        public static readonly SqlKeywords LEADING = new SqlKeywords("LEADING");
        public static readonly SqlKeywords LEFT = new SqlKeywords("LEFT");
        public static readonly SqlKeywords LEVEL = new SqlKeywords("LEVEL");
        public static readonly SqlKeywords LIKE = new SqlKeywords("LIKE");
        public static readonly SqlKeywords LOCAL = new SqlKeywords("LOCAL");
        public static readonly SqlKeywords LOWER = new SqlKeywords("LOWER");
        public static readonly SqlKeywords MATCH = new SqlKeywords("MATCH");
        public static readonly SqlKeywords MAX = new SqlKeywords("MAX");
        public static readonly SqlKeywords MIN = new SqlKeywords("MIN");
        public static readonly SqlKeywords MINUTE = new SqlKeywords("MINUTE");
        public static readonly SqlKeywords MODULE = new SqlKeywords("MODULE");
        public static readonly SqlKeywords MONTH = new SqlKeywords("MONTH");
        public static readonly SqlKeywords NAMES = new SqlKeywords("NAMES");
        public static readonly SqlKeywords NATIONAL = new SqlKeywords("NATIONAL");
        public static readonly SqlKeywords NATURAL = new SqlKeywords("NATURAL");
        public static readonly SqlKeywords NCHAR = new SqlKeywords("NCHAR");
        public static readonly SqlKeywords NEXT = new SqlKeywords("NEXT");
        public static readonly SqlKeywords NO = new SqlKeywords("NO");
        public static readonly SqlKeywords NONE = new SqlKeywords("NONE");
        public static readonly SqlKeywords NOT = new SqlKeywords("NOT");
        public static readonly SqlKeywords NULL = new SqlKeywords("NULL");
        public static readonly SqlKeywords NULLIF = new SqlKeywords("NULLIF");
        public static readonly SqlKeywords NUMERIC = new SqlKeywords("NUMERIC");
        public static readonly SqlKeywords OCTET_LENGTH = new SqlKeywords("OCTET_LENGTH");
        public static readonly SqlKeywords OF = new SqlKeywords("OF");
        public static readonly SqlKeywords OJ = new SqlKeywords("OJ");
        public static readonly SqlKeywords ON = new SqlKeywords("ON");
        public static readonly SqlKeywords ONLY = new SqlKeywords("ONLY");
        public static readonly SqlKeywords OPEN = new SqlKeywords("OPEN");
        public static readonly SqlKeywords OPTION = new SqlKeywords("OPTION");
        public static readonly SqlKeywords OR = new SqlKeywords("OR");
        public static readonly SqlKeywords ORDER = new SqlKeywords("ORDER");
        public static readonly SqlKeywords OUTER = new SqlKeywords("OUTER");
        public static readonly SqlKeywords OUTPUT = new SqlKeywords("OUTPUT");
        public static readonly SqlKeywords OVERLAPS = new SqlKeywords("OVERLAPS");
        public static readonly SqlKeywords PAD = new SqlKeywords("PAD");
        public static readonly SqlKeywords PARTIAL = new SqlKeywords("PARTIAL");
        public static readonly SqlKeywords PASCAL = new SqlKeywords("PASCAL");
        public static readonly SqlKeywords POSITION = new SqlKeywords("POSITION");
        public static readonly SqlKeywords PRECISION = new SqlKeywords("PRECISION");
        public static readonly SqlKeywords PREPARE = new SqlKeywords("PREPARE");
        public static readonly SqlKeywords PRESERVE = new SqlKeywords("PRESERVE");
        public static readonly SqlKeywords PRIMARY = new SqlKeywords("PRIMARY");
        public static readonly SqlKeywords PRIOR = new SqlKeywords("PRIOR");
        public static readonly SqlKeywords PRIVILEGES = new SqlKeywords("PRIVILEGES");
        public static readonly SqlKeywords PROCEDURE = new SqlKeywords("PROCEDURE");
        public static readonly SqlKeywords PUBLIC = new SqlKeywords("PUBLIC");
        public static readonly SqlKeywords READ = new SqlKeywords("READ");
        public static readonly SqlKeywords REAL = new SqlKeywords("REAL");
        public static readonly SqlKeywords REFERENCES = new SqlKeywords("REFERENCES");
        public static readonly SqlKeywords RELATIVE = new SqlKeywords("RELATIVE");
        public static readonly SqlKeywords RESTRICT = new SqlKeywords("RESTRICT");
        public static readonly SqlKeywords REVOKE = new SqlKeywords("REVOKE");
        public static readonly SqlKeywords RIGHT = new SqlKeywords("RIGHT");
        public static readonly SqlKeywords ROLLBACK = new SqlKeywords("ROLLBACK");
        public static readonly SqlKeywords ROWS = new SqlKeywords("ROWS");
        public static readonly SqlKeywords SCHEMA = new SqlKeywords("SCHEMA");
        public static readonly SqlKeywords SCROLL = new SqlKeywords("SCROLL");
        public static readonly SqlKeywords SECOND = new SqlKeywords("SECOND");
        public static readonly SqlKeywords SECTION = new SqlKeywords("SECTION");
        public static readonly SqlKeywords SELECT = new SqlKeywords("SELECT");
        public static readonly SqlKeywords SESSION = new SqlKeywords("SESSION");
        public static readonly SqlKeywords SESSION_USER = new SqlKeywords("SESSION_USER");
        public static readonly SqlKeywords SET = new SqlKeywords("SET");
        public static readonly SqlKeywords SIZE = new SqlKeywords("SIZE");
        public static readonly SqlKeywords SMALLINT = new SqlKeywords("SMALLINT");
        public static readonly SqlKeywords SOME = new SqlKeywords("SOME");
        public static readonly SqlKeywords SPACE = new SqlKeywords("SPACE");
        public static readonly SqlKeywords Sql = new SqlKeywords("Sql");
        public static readonly SqlKeywords SqlCA = new SqlKeywords("SqlCA");
        public static readonly SqlKeywords SqlCODE = new SqlKeywords("SqlCODE");
        public static readonly SqlKeywords SqlERROR = new SqlKeywords("SqlERROR");
        public static readonly SqlKeywords SqlSTATE = new SqlKeywords("SqlSTATE");
        public static readonly SqlKeywords SqlWARNING = new SqlKeywords("SqlWARNING");
        public static readonly SqlKeywords SUBSTRING = new SqlKeywords("SUBSTRING");
        public static readonly SqlKeywords SUM = new SqlKeywords("SUM");
        public static readonly SqlKeywords SYSTEM_USER = new SqlKeywords("SYSTEM_USER");
        public static readonly SqlKeywords TABLE = new SqlKeywords("TABLE");
        public static readonly SqlKeywords TEMPORARY = new SqlKeywords("TEMPORARY");
        public static readonly SqlKeywords THEN = new SqlKeywords("THEN");
        public static readonly SqlKeywords TIME = new SqlKeywords("TIME");
        public static readonly SqlKeywords TIMESTAMP = new SqlKeywords("TIMESTAMP");
        public static readonly SqlKeywords TIMEZONE_HOUR = new SqlKeywords("TIMEZONE_HOUR");
        public static readonly SqlKeywords TIMEZONE_MINUTE = new SqlKeywords("TIMEZONE_MINUTE");
        public static readonly SqlKeywords TO = new SqlKeywords("TO");
        public static readonly SqlKeywords TRAILING = new SqlKeywords("TRAILING");
        public static readonly SqlKeywords TRANSACTION = new SqlKeywords("TRANSACTION");
        public static readonly SqlKeywords TRANSLATE = new SqlKeywords("TRANSLATE");
        public static readonly SqlKeywords TRANSLATION = new SqlKeywords("TRANSLATION");
        public static readonly SqlKeywords TRIM = new SqlKeywords("TRIM");
        public static readonly SqlKeywords TRUE = new SqlKeywords("TRUE");
        public static readonly SqlKeywords UNION = new SqlKeywords("UNION");
        public static readonly SqlKeywords UNIQUE = new SqlKeywords("UNIQUE");
        public static readonly SqlKeywords UNKNOWN = new SqlKeywords("UNKNOWN");
        public static readonly SqlKeywords UPDATE = new SqlKeywords("UPDATE");
        public static readonly SqlKeywords UPPER = new SqlKeywords("UPPER");
        public static readonly SqlKeywords USAGE = new SqlKeywords("USAGE");
        public static readonly SqlKeywords USER = new SqlKeywords("USER");
        public static readonly SqlKeywords USING = new SqlKeywords("USING");
        public static readonly SqlKeywords VALUE = new SqlKeywords("VALUE");
        public static readonly SqlKeywords VALUES = new SqlKeywords("VALUES");
        public static readonly SqlKeywords VARCHAR = new SqlKeywords("VARCHAR");
        public static readonly SqlKeywords VARYING = new SqlKeywords("VARYING");
        public static readonly SqlKeywords VIEW = new SqlKeywords("VIEW");
        public static readonly SqlKeywords WHEN = new SqlKeywords("WHEN");
        public static readonly SqlKeywords WHENEVER = new SqlKeywords("WHENEVER");
        public static readonly SqlKeywords WHERE = new SqlKeywords("WHERE");
        public static readonly SqlKeywords WITH = new SqlKeywords("WITH");
        public static readonly SqlKeywords WORK = new SqlKeywords("WORK");
        public static readonly SqlKeywords WRITE = new SqlKeywords("WRITE");
        public static readonly SqlKeywords YEAR = new SqlKeywords("YEAR");
        public static readonly SqlKeywords ZONE = new SqlKeywords("ZONE");
        public static readonly SqlKeywords FN = new SqlKeywords("FN");
    }
}
